package file.util;

import file.FileInfo;

/**
 * @author hh
 * @since 2025/3/24
 */
public class FileInfoUtil {

    public static FileInfo getFileInfo(String[] fileInfoSplit) {
        if (fileInfoSplit.length == 2) {
            return new FileInfo(fileInfoSplit[0], fileInfoSplit[1], null, null);
        } else if (fileInfoSplit.length == 3) {
            return new FileInfo(fileInfoSplit[0], fileInfoSplit[1], null, fileInfoSplit[2]);
        } else if (fileInfoSplit.length == 4) {
            return new FileInfo(fileInfoSplit[0], fileInfoSplit[1], fileInfoSplit[2], fileInfoSplit[3]);
        }
        return null;
    }
}
